#!/usr/bin/env python3

import sys

def do_cat(file):
    #  f = open(file)

    #  #  a = 1
    #  #  for line in f.readlines():
        #  #  print("%5d  %s" % (a, line), end='')
        #  #  a += 1

    #  #  for index, line in enumerate(f.readlines()):
        #  #  print("%5d  %s" % (index + 1, line), end='')

    #  for index, line in enumerate(f):
        #  print("%5d  %s" % (index + 1, line), end='')

    #  f.close()

    for index, line in enumerate(open(file)):
        print("%5d  %s" % (index + 1, line), end='')


def main(argv):
    if len(argv) < 2:
        print("请指定目标文件路径!")
        return
    do_cat(argv[1])

if __name__ == "__main__":
    main(sys.argv)
